﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DQYT.HTDZ.IDAL;
using Best.Framework.DALFactory;
using DQYT.HTDZ.Model;
using System.Data;

namespace DQYT.HTDZ.BLL
{
    public class BDMenuBLL
    {
        private readonly IBDMenu dal = DataAccess.CreateBDMenu();

        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int MNU_ID)
        {
            return dal.Exists(MNU_ID);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(BDMenuModel model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BDMenuModel model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int MNU_ID)
        {
            return dal.Delete(MNU_ID);
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string MNU_IDlist)
        {
            return dal.DeleteList(MNU_IDlist);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BDMenuModel GetModel(int MNU_ID)
        {
            return dal.GetModel(MNU_ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }



        #endregion  Method

        #region 新添加
        /// <summary>
        /// 获得菜单根据角色ID
        /// </summary>
        /// <param name="JSE_ID">角色ID</param>
        /// <returns>返回菜单数据表</returns>
        public DataTable GetMenu(int JSE_ID, int parentId)
        {
            return dal.GetMenu(JSE_ID, parentId);
        }

        /// <summary>
        /// 获得页面标题路径
        /// </summary>
        /// <param name="MNU_ID">菜单ID</param>
        /// <returns></returns>
        public string GetTitlePath(string MNU_ID)
        {
            return dal.GetTitlePath(MNU_ID);
        }

        /// <summary>
        /// 获得记录数
        /// </summary>
        /// <param name="strWhere">查询条件</param>
        /// <returns></returns>
        public int GetNum(string strWhere)
        {
            return dal.GetNum(strWhere);
        }
        /// <summary>
        /// 获得下一个最大值
        /// </summary>
        /// <returns></returns>
        public int GetNextID()
        {
            return dal.GetNextID();
        }
        #endregion
    }
}
